import 'dart:ui';
import 'package:flutter/material.dart';

class DotPainter extends CustomPainter {

  Offset mGlobalPosition;
  Paint _mPaint = Paint();

  DotPainter(this.mGlobalPosition);

  @override
  void paint(Canvas canvas, Size size) {
    _mPaint..color = Colors.red
      ..strokeWidth = 100
      ..strokeCap = StrokeCap.round
      ..isAntiAlias = true;
    _drawXyDot(canvas);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }

  void _drawXyDot(Canvas canvas) {
    print('globalPosition == $mGlobalPosition');
    canvas.drawPoints(PointMode.points, [mGlobalPosition], _mPaint);
  }

}